package com.yc.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: lite_monitoring
 * @description: 命令行参数类
 * @author: zy
 * @create: 2025-03-19 21:33
 */
public class CommandLineArgs {
    private final Map<String, String> args = new HashMap<>();

    public void addArg(String argName, String argValue) {
        this.args.put(argName, argValue);
    }

    public boolean contains(String argName) {
        return this.args.containsKey(argName);
    }

    public String getArg(String argName) {
        return this.args.get(argName);
    }

    public Integer getIntArg(String argName) {
        String argValue = this.getArg(argName);
        return argValue == null ? null : Integer.valueOf(argValue);
    }
}
